<?php
/**
 * Page Template
 *
 * Displays EZ-Pages Header-Bar content.<br />
 *
 * @package templateSystem
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_ezpages_bar_header.php 3377 2006-04-05 04:43:11Z ajeh $
 */

  /**
   * require code to show EZ-Pages list
   */


      $categories_query = "select c.categories_id, cd.categories_name, c.parent_id, c.categories_image
                             from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
                             where c.parent_id = 0
                             and c.categories_id = cd.categories_id
                             and cd.language_id='" . (int)$_SESSION['languages_id'] . "'
                             and c.categories_status= 1
                             order by sort_order, cd.categories_name";
 
    $categories = $db->Execute($categories_query, '', true, 150);
	  $rows = 0;
    while (!$categories->EOF)  {
	$rows++;
	  $page_query_list_header[$rows]['id']  = $categories->fields['categories_id'];
      $page_query_list_header[$rows]['name'] = $categories->fields['categories_name'];
      $page_query_list_header[$rows]['link'] = $categories->fields['categories_id'];
      $categories->MoveNext();
    }
	  $var_linksList = $page_query_list_header;
	

?>
<?php if (sizeof($var_linksList) >= 1) { ?>

<?php
$num=8;
for ($i=1, $n=sizeof($var_linksList); $i<$num; $i++) { 

  ?>  
  <span class="<?php echo 'li'.$i; if(($i+1)==$num){echo'  last';} ?> CategoryMenuItem"><a class="CategoryMenuItemLink" href="<?php echo zen_href_link(FILENAME_DEFAULT,'cPath='.$var_linksList[$i]['link']); ?>"><?php echo $var_linksList[$i]['name']; ?></a></span><?php if(($i+1)!=$num){
  	echo zen_image($template->get_template_dir('efc_category_line.jpg', DIR_WS_TEMPLATE, $current_page_base, 'images/')  . 'efc_category_line.jpg','',2,12);
 
  } ?>
<?php } // end FOR loop ?>
<?php } ?>


